package com.qijian.production.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qijian.common.core.domain.entity.SysUser;
import com.qijian.production.domain.PointOrder;
import com.qijian.production.domain.query.PointOrderQuery;
import com.qijian.production.domain.vo.PointOrderVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 非标准定额申请单Mapper接口
 *
 * @author qijian
 * @date 2023-12-06
 */
public interface PointOrderMapper extends BaseMapper<PointOrder> {

    @Select("select count(0) from main_point_order WHERE create_time >= CURRENT_DATE ")
    int countCurrentDateWithDel();

    PointOrderVo selectVoById(Long id);

    List<PointOrderVo> selectVoByCondition(@Param(Constants.WRAPPER) Wrapper<PointOrderQuery> queryWrapper);

    Page<PointOrderVo> selectVo(Page<PointOrderVo> page, @Param(Constants.WRAPPER) Wrapper<PointOrderQuery> queryWrapper);

    /***
     * 根据projectId找到bom工艺员id发送提醒消息
     * @param projectIds
     * @return
     */
    List<SysUser> selectBomCraftUserIds(@Param("projectIds") List<Long> projectIds);

    SysUser selectBomCraftUserIdsByBomId(Long bomId);
}
